import sys
import shutil


shutil.copyfile('1.log','2.log')

def log(path,content):
    saveout = sys.stdout
    f = open(path,'w')
    sys.stdout = f

    print(content)

    sys.stdout = saveout
    f.close()